package cosmos.properties;


import lodsve.core.properties.relaxedbind.annotations.ConfigurationProperties;
import lodsve.core.properties.relaxedbind.annotations.Required;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.springframework.core.io.Resource;

import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * .
 *
 * @author sunhao(sunhao.java @ gmail.com)
 * @version V1.0, 15/12/30 上午10:28
 */
@ConfigurationProperties(prefix = "test", locations = "classpath:/META-INF/config.properties")
public class TestTestConfig {
    private String string;
    private boolean success1;
    private Boolean success2;
    private Long length1;
    private long length2;
    private Integer sum1;
    private int sum2;
    private Double money1;
    private double money2;
    private Map<String, ProjectSetting> project;
    private Demo demo;
    @Required
    private String fuck;
    private String fuck2;

    private String[] args;
    private ProjectSetting[] settings;
    private Class<?> clazz;

    private List<String> args1;
    private Set<String> args2;
    private List<ProjectSetting> settings1;

    private Resource resource;
    private File file;
    private Properties properties1;

    private Sex sex;

    public String getString() {
        return string;
    }

    public void setString(String string) {
        this.string = string;
    }

    public boolean isSuccess1() {
        return success1;
    }

    public void setSuccess1(boolean success1) {
        this.success1 = success1;
    }

    public Boolean getSuccess2() {
        return success2;
    }

    public void setSuccess2(Boolean success2) {
        this.success2 = success2;
    }

    public Long getLength1() {
        return length1;
    }

    public void setLength1(Long length1) {
        this.length1 = length1;
    }

    public long getLength2() {
        return length2;
    }

    public void setLength2(long length2) {
        this.length2 = length2;
    }

    public Integer getSum1() {
        return sum1;
    }

    public void setSum1(Integer sum1) {
        this.sum1 = sum1;
    }

    public int getSum2() {
        return sum2;
    }

    public void setSum2(int sum2) {
        this.sum2 = sum2;
    }

    public Double getMoney1() {
        return money1;
    }

    public void setMoney1(Double money1) {
        this.money1 = money1;
    }

    public double getMoney2() {
        return money2;
    }

    public void setMoney2(double money2) {
        this.money2 = money2;
    }

    public Map<String, ProjectSetting> getProject() {
        return project;
    }

    public void setProject(Map<String, ProjectSetting> project) {
        this.project = project;
    }

    public Demo getDemo() {
        return demo;
    }

    public void setDemo(Demo demo) {
        this.demo = demo;
    }

    public String getFuck() {
        return fuck;
    }

    public String getFuck2() {
        return fuck2;
    }

    public void setFuck2(String fuck2) {
        this.fuck2 = fuck2;
    }

    public void setFuck(String fuck) {
        this.fuck = fuck;
    }

    public String[] getArgs() {
        return args;
    }

    public void setArgs(String[] args) {
        this.args = args;
    }

    public ProjectSetting[] getSettings() {
        return settings;
    }

    public void setSettings(ProjectSetting[] settings) {
        this.settings = settings;
    }

    public Class<?> getClazz() {
        return clazz;
    }

    public void setClazz(Class<?> clazz) {
        this.clazz = clazz;
    }

    public List<String> getArgs1() {
        return args1;
    }

    public void setArgs1(List<String> args1) {
        this.args1 = args1;
    }

    public Set<String> getArgs2() {
        return args2;
    }

    public void setArgs2(Set<String> args2) {
        this.args2 = args2;
    }

    public List<ProjectSetting> getSettings1() {
        return settings1;
    }

    public void setSettings1(List<ProjectSetting> settings1) {
        this.settings1 = settings1;
    }

    public Resource getResource() {
        return resource;
    }

    public void setResource(Resource resource) {
        this.resource = resource;
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public Properties getProperties1() {
        return properties1;
    }

    public void setProperties1(Properties properties1) {
        this.properties1 = properties1;
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

    public static class Demo {
        private String string;
        private boolean success1;
        private Boolean success2;
        private Long length1;
        private long length2;
        private Integer sum1;
        private int sum2;
        private Double money1;
        private double money2;

        public String getString() {
            return string;
        }

        public void setString(String string) {
            this.string = string;
        }

        public boolean isSuccess1() {
            return success1;
        }

        public void setSuccess1(boolean success1) {
            this.success1 = success1;
        }

        public Boolean getSuccess2() {
            return success2;
        }

        public void setSuccess2(Boolean success2) {
            this.success2 = success2;
        }

        public Long getLength1() {
            return length1;
        }

        public void setLength1(Long length1) {
            this.length1 = length1;
        }

        public long getLength2() {
            return length2;
        }

        public void setLength2(long length2) {
            this.length2 = length2;
        }

        public Integer getSum1() {
            return sum1;
        }

        public void setSum1(Integer sum1) {
            this.sum1 = sum1;
        }

        public int getSum2() {
            return sum2;
        }

        public void setSum2(int sum2) {
            this.sum2 = sum2;
        }

        public Double getMoney1() {
            return money1;
        }

        public void setMoney1(Double money1) {
            this.money1 = money1;
        }

        public double getMoney2() {
            return money2;
        }

        public void setMoney2(double money2) {
            this.money2 = money2;
        }

        @Override
        public String toString() {
            return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
        }
    }

    public static class ProjectSetting {
        private String url = "redis://localhost:6379/0";
        private int timeout = 100000;

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public int getTimeout() {
            return timeout;
        }

        public void setTimeout(int timeout) {
            this.timeout = timeout;
        }

        @Override
        public String toString() {
            return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
        }
    }

    public enum Sex {
        nanren, nvren, bunanbunv
    }
}
